{% extends "shop/admin/base/base.html" %}

{% block body %}
<div>
    <div class="page-header"><h1>商品管理</h1></div>
    <div style="margin-bottom: 20px;">
        <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal" id="addgoods" link="/admin/goods/goodsinfo">添加商品</button>
    </div>
    <div>
        <table class="table table-bordered table-hover">
           <thead>
              <tr>
                 <th>编号</th>
                 <th>名称</th>
                 <th>商品分类</th>
                 <th>销售价</th>
                 <th>是否上架</th>
                 <th>是否上线</th>
                 <th>创建时间</th>
                 <th>操作</th>
              </tr>
           </thead>
           <tbody>
              <tr>
                 <td></td>
                 <td></td>
                 <td></td>
                 <td></td>
                 <td></td>
                 <td></td>
                 <td></td>
                 <td></td>
              </tr>
           </tbody>
        </table>
    </div>
</div>
            <form class="form-horizontal" role="form" action="" method="post" enctype ="multipart/form-data" runat="server">
<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
   <div class="modal-dialog" style="width: 80%;max-width: 1200px;">
      <div class="modal-content">
         <div class="modal-header">
            <button type="button" class="close" 
               data-dismiss="modal" aria-hidden="true">
                  &times;
            </button>
            <h4 class="modal-title" id="myModalLabel">
               添加商品
            </h4>
         </div>
         <div class="modal-body" id="modelbody">
         </div>
         <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal">关闭
            </button>
            <button type="button" onclick="addgoods()" class="btn btn-primary">
               添加
            </button>
         </div>
      </div><!-- /.modal-content -->
</div><!-- /.modal -->
            </form>
<script type="text/javascript">
    page = "shop";
    pclass = "goods";

    start = function(){
        $('#addgoods').click(function(){
            $('#myModalLabel').html('添加商品');
            alink(this, function(data){
                $('#modelbody').html(data);
            });
        });
    }
</script>
{% endblock %}